function renderQues(data) {
	//			data = data.data;
	var qindex = 0; //题目的编号索引
	var action = 0;
	var swiper = new Swiper('.swiper-container', {
		loop: true,
		onInit: function(swiper) {
			var selectitems = swiper.slides[swiper.activeIndex].getElementsByClassName('selectitems');
			var length = selectitems.length;
//			alert(length);
			for (var i = 0; i < length; i++) {
				//						alert(i);
				var id = selectitems[i].getAttribute('id');
				var type = selectitems[i].getAttribute('data-type');
				//						alert(id+type);
				if (type == "material") {
					//							return;
				} else {
					var choiceitem = document.getElementById(id).getElementsByClassName('selectitem');
					var myans = MYPAGE.data[id];
					if (typeof(myans) != "undefined") {
						//								myans = myans.split(",");
						//								alert(myans);
						for (var j = 0; j < myans.length; j++) {
							if (type == "determine") {
								//判断处理
								if (myans[j] == 1) {
									choiceitem[0].className = "selectitem onrightitem selected";
								} else if (myans[j] == 0) {
									choiceitem[1].className = "selectitem onwrongitem selected";
								}
							} else {
								//选项处理
//								alert(myans[j]);
								choiceitem[myans[j]].className = "selectitem selected";
							}
						}
					}
				}
			}
			//读取答题数据,显示页面答案	
		},
		onSlideChangeStart: function(swiper) {
			swiper.unlockSwipeToNext();
			var cindex = swiper.activeIndex;
			var thisheight = swiper.slides[cindex].offsetHeight + 'px';
			if (thisheight != "0px") {
				swiper.container[0].style.height = thisheight;
			}
			var oldindex = swiper.previousIndex;
			var nextindexEle = document.getElementsByClassName('swiper-slide-next')[0];
			if (typeof(nextindexEle) == "undefined") {
				nextindex = 2;
			} else {
				nextindex = parseInt(nextindexEle.getAttribute('data-swiper-slide-index')) + 1;
			}
			if (nextindex == 1) {
				nextindex = 11;
			}
			if (cindex > oldindex) {
				qindex++
			} else if (cindex < oldindex) {
				qindex--
			}
			MYPAGE.pageno = qindex + 1;
			if (MYPAGE.pageno < MYPAGE.questionNum || MYPAGE.pageno == MYPAGE.questionNum) {
				var html = template('qitem', data[qindex].question);
				swiper.slides[nextindex].innerHTML = html;
				if (nextindex == 11) {
					swiper.slides[1].innerHTML = html;
				}
				if (nextindex == 10) {
					swiper.slides[0].innerHTML = html;
				}
				if (qindex == 1) {
					swiper.lockSwipeToPrev();
					MYPAGE.pageno = 1;
					html = template('qitem', data[qindex - 1].question);
					swiper.slides[cindex].innerHTML = html;
				} else {
					swiper.unlockSwipeToPrev();
				}
				window.scrollTo(0, 0);
				api.sendEvent({
					name: 'slideChange',
					extra: {
						pageno: qindex,
						total: MYPAGE.questionNum
					}
				});
			} else {
				swiper.lockSwipeToNext();
				api.toast({
					msg: "没有题目了哦！"
				});
				api.sendEvent({
					name: 'slideChange',
					extra: {
						pageno: qindex,
						total: MYPAGE.questionNum
					}
				});
			}
		},
		onSlideChangeEnd: function(swiper) {
			localStorage.setItem('answer' + MYPAGE.testid, JSON.stringify(MYPAGE.data)); //翻页时存储答题数据
			var selectitems = swiper.slides[swiper.activeIndex].getElementsByClassName('selectitems');
			var length = selectitems.length;
			for (var i = 0; i < length; i++) {
				//						alert(i);
				var id = selectitems[i].getAttribute('id');
				var type = selectitems[i].getAttribute('data-type');
				//						alert(id+type);
				if (type == "material") {
					//							return;
				} else {
					var choiceitem = document.getElementById(id).getElementsByClassName('selectitem');
					var myans = MYPAGE.data[id];
					if (typeof(myans) != "undefined") {
						//								myans = myans.split(",");
						//								alert(myans);
						for (var j = 0; j < myans.length; j++) {
							if (type == "determine") {
								//判断处理
								if (myans[j] == 1) {
									choiceitem[0].className = "selectitem onrightitem selected";
								} else if (myans[j] == 0) {
									choiceitem[1].className = "selectitem onwrongitem selected";
								}
							} else {
								//选项处理
								choiceitem[myans[j]].className = "selectitem selected";
							}
						}
					}
				}
			}
			//读取答题数据,显示页面答案	
		}
	});
	api.addEventListener({
		name: 'slideNext'
	}, function(ret, err) {
		swiper.slideNext();
	});
	api.addEventListener({
		name: 'slidePrev'
	}, function(ret, err) {
		swiper.slidePrev();
	});
	//			api.addEventListener({
	//				name: 'showAnswer'
	//			}, function(ret, err) {
	//				swiper.slides[swiper.activeIndex].getElementsByClassName('jiexiArea')[0].style.visibility = "visible";
	//			});
	//			api.addEventListener({
	//				name: 'Answer'
	//			}, function(ret, err) {
	//				swiper.slides[swiper.activeIndex].getElementsByClassName('jiexiArea')[0].style.visibility = "hidden";
	//			});
	//			api.addEventListener({
	//				name: 'favor'
	//			}, function(ret, err) {
	//				var qid = swiper.slides[swiper.activeIndex].getElementsByClassName('qid')[0].value;
	//				api.toast({
	//					msg: "已收藏" + qid
	//				});
	//			});
}